package org.hydrakyoufeng.stuplatform.service.impl;

import org.hydrakyoufeng.stuplatform.mapper.EchartsMapper;
import org.hydrakyoufeng.stuplatform.service.EchartsService;
import org.hydrakyoufeng.stuplatform.utils.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EchartsServiceImpl implements EchartsService {

    @Autowired
    private EchartsMapper echartsMapper;
    @Override
    public ResultEntity queryUserList(String type) throws Exception {
        if ("year".equals(type)) {
            return ResultEntity.success("查询成功",echartsMapper.queryUserYearList());
        } else if ("month".equals(type)) {
            return ResultEntity.success("查询成功",echartsMapper.queryUserMonthList());
        } else {
            return ResultEntity.success("查询成功",echartsMapper.queryUserWeekList());
        }

    }

    @Override
    public ResultEntity queryCourseList() {
        return ResultEntity.success("查询成功",echartsMapper.queryCourseList());
    }
}
